package com.atguigu.springcloud.entities;

/**
 * Created by IntelliJ IDEA.
 * User: zhuangzibing
 * Date: 2020/7/16
 */
public class MessageTask {
    private String taskId;
    private String content;
    private String messageId;
    private String taskName;

    //2创建个构造函数
    private MessageTask(Builder builder){
        this.taskId = builder.taskId;
        this.content = builder.content;
        this.messageId = builder.messageId;
        this.taskName = builder.taskName;
    }

    //1创建静态内部类
    public static class Builder{
        private String taskId;
        private String content;
        private String messageId;
        private String taskName;

        //3在Builder内部类创建domain属性的赋值方法，返回值是Builder
        // 赋值属性的方法（返回的是Builder）
        public Builder setTaskId(String taskId) {
            this.taskId = taskId;
            return this;
        }
        public Builder setContent(String content) {
            this.content = content;
            return this;

        }
        public Builder setMessageId(String messageId) {
            this.messageId = messageId;
            return this;

        }
        public Builder setTaskName(String taskName) {
            this.taskName = taskName;
            return this;
        }


        // 4在Builder内部类创建一个builde方法，返回domain实例
        public MessageTask build() {
            return new MessageTask(this);
        }
    }
}
